package com.ccit.model;

import com.alibaba.fastjson.JSONObject;

/**
 * role_permission实体类
 * 
 * @author 
 *
 */
public class RolePermission {
	/***/
	private String roleId; 
	/***/
	private String permissionId; 
	/**
	 * 实例化
	 */
	public RolePermission() {
		super();
	}
	/**
	 * 实例化
	 * 
	 * @param obj
	 */
	public RolePermission(JSONObject obj) {
		this();
		if (obj.get("roleId") instanceof String) {
			this.setRoleId((String) obj.get("roleId"));
		}
		if (obj.get("permissionId") instanceof String) {
			this.setPermissionId((String) obj.get("permissionId"));
		}
	}
	
	/**
	 * 将当前对象转换为JsonObject
	 * 
	 * @return
	 */
	public JSONObject toJson() {
		JSONObject result = new JSONObject();
		if (this.getRoleId() != null) {
			result.put("roleId",this.getRoleId());
		}
		if (this.getPermissionId() != null) {
			result.put("permissionId",this.getPermissionId());
		}
		return result;
	}
	
	
	/**
	 * 获取roleId
	 * 
	 * @return
	 */
	public String getRoleId() {
		return roleId;
	}

	/**
	 * 设置roleId
	 * 
	 * @param roleId
	 */
	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}
	
	/**
	 * 获取permissionId
	 * 
	 * @return
	 */
	public String getPermissionId() {
		return permissionId;
	}

	/**
	 * 设置permissionId
	 * 
	 * @param permissionId
	 */
	public void setPermissionId(String permissionId) {
		this.permissionId = permissionId;
	}

	@Override
	public String toString() {
		return "RolePermission [roleId=" + roleId + " , permissionId=" + permissionId + "  ]";
	
	}
	
	
}
